home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
lisp
/
eulisp
/
mpfeel.lha
/
MPFeel
/
Plurals
/
mp_debug.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-12
|
2KB
|
73 lines
/*
* Debugging
*
* Author: S.C.Merrall
*
* File: debug_off.h
*
* Contents: DBG_CALL - register function entry
* DBG_ARGS - list argument values
* DBG_EXIT - register function exit
*
* Description: This contains dummy entries for the debug.h macros
* This header is included into a file when you want
* to stop debug output in that file
*
* Change History:
*
* Date Name Comment
* -------- ---- -------
* 06:02:91 SCM Created
*
*/
#ifdef DBG_2_STDERR
#define dbg stderr
#else
extern FILE *dbg;
#endif
extern char *dbg_g_fname;
extern plural short dbg_g_active;
extern char *spaces;
extern int debug_status;
#define DBG_ON() debug_status=TRUE
#define DBG_OFF() debug_status=FAIL
#ifdef __STDC__
extern int init_debug( void );
#else
extern int init_debug();
#endif
#define DBG_CALL(name) char *old_dbg_fname=dbg_g_fname;char *dbg_fname = name;\
dbg_g_fname = dbg_fname
#define DBG_ARGS(args) if (debug_status) {fprintf(dbg,"%s(",dbg_fname);args;fprintf(dbg,")\n");}
#define DBG_EXIT(out) if (debug_status) {fprintf(dbg,"%s => ",dbg_fname);out;fprintf(dbg,"\n");}\
dbg_g_fname=old_dbg_fname
#define DBG_NULL(ptr)
#define DBG_FAIL(out) fprintf(dbg,"%s => ",dbg_fname);out;fprintf(dbg,"\n");\
dbg_g_fname=old_dbg_fname
#define DBG_EROR(err) mp_error = err;return FAIL
#define DBG_NO_OF_PES 7
#define DBG_CTXT() dbg_g_active=enumerate();if (dbg_g_active<DBG_NO_OF_PES)
#define DBG_PVAR(str,name,format,value) fprintf(str,"%s=",name);dbg_g_active=enumerate(); if(dbg_g_active<DBG_NO_OF_PES) p_fprintf(str,format,value);fprintf(str,"...")
#define DBG_PARG(name,format,value) DBG_PVAR(dbg,name,format,value)
#define DEBUG(body) if (debug_status) {fprintf(dbg,"%s debug: ",dbg_fname);body;fprintf(dbg,"\n");}
#define DO_DEBUG(body) DEBUG(body)